/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tp_imag.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "PIVOTE")
@NamedQueries({@NamedQuery(name = "Pivote.findAll", query = "SELECT p FROM Pivote p"), @NamedQuery(name = "Pivote.findById", query = "SELECT p FROM Pivote p WHERE p.id = :id"), @NamedQuery(name = "Pivote.findBySsselementId", query = "SELECT p FROM Pivote p WHERE p.ssselementId = :ssselementId")})
public class Pivote implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "SSSELEMENT_ID")
    private Integer ssselementId;
    @JoinColumn(name = "ID", referencedColumnName = "ID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private SSSelement sSSelement;

    public Pivote() {
    }

    public Pivote(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSsselementId() {
        return ssselementId;
    }

    public void setSsselementId(Integer ssselementId) {
        this.ssselementId = ssselementId;
    }

    public SSSelement getSSSelement() {
        return sSSelement;
    }

    public void setSSSelement(SSSelement sSSelement) {
        this.sSSelement = sSSelement;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pivote)) {
            return false;
        }
        Pivote other = (Pivote) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tp_imag.model.Pivote[id=" + id + "]";
    }

}
